From e1d13ddb536f7e60e0b2389dd40dcf99827df9b6 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sun, 19 Mar 2006 15:17:50 +0100 Subject: [PATCH] Move arch/x86 to new build system. Signed-off-by: Keir Fraser --- xen/Makefile | 1 + xen/Post.mk | 3 +- xen/Rules.mk | 7 +- xen/arch/x86/Makefile | 112 ++++++++++++--------------- xen/arch/x86/Rules.mk | 6 +- xen/arch/x86/acpi/Makefile | 5 ++ xen/arch/x86/cpu/Makefile | 16 ++++ xen/arch/x86/cpu/mcheck/Makefile | 11 +++ xen/arch/x86/cpu/mtrr/Makefile | 10 +++ xen/arch/x86/genapic/Makefile | 10 +++ xen/arch/x86/hvm/Makefile | 14 ++++ xen/arch/x86/hvm/svm/Makefile | 12 +++ xen/arch/x86/hvm/svm/x86_32/Makefile | 5 ++ xen/arch/x86/hvm/svm/x86_64/Makefile | 5 ++ xen/arch/x86/hvm/vmx/Makefile | 10 +++ xen/arch/x86/hvm/vmx/x86_32/Makefile | 5 ++ xen/arch/x86/hvm/vmx/x86_64/Makefile | 5 ++ xen/arch/x86/x86_32/Makefile | 11 +++ xen/arch/x86/x86_64/Makefile | 7 ++ xen/common/Makefile | 1 - 20 files changed, 183 insertions(+), 73 deletions(-) create mode 100644 xen/arch/x86/acpi/Makefile create mode 100644 xen/arch/x86/cpu/Makefile create mode 100644 xen/arch/x86/cpu/mcheck/Makefile create mode 100644 xen/arch/x86/cpu/mtrr/Makefile create mode 100644 xen/arch/x86/genapic/Makefile create mode 100644 xen/arch/x86/hvm/Makefile create mode 100644 xen/arch/x86/hvm/svm/Makefile create mode 100644 xen/arch/x86/hvm/svm/x86_32/Makefile create mode 100644 xen/arch/x86/hvm/svm/x86_64/Makefile create mode 100644 xen/arch/x86/hvm/vmx/Makefile create mode 100644 xen/arch/x86/hvm/vmx/x86_32/Makefile create mode 100644 xen/arch/x86/hvm/vmx/x86_64/Makefile create mode 100644 xen/arch/x86/x86_32/Makefile create mode 100644 xen/arch/x86/x86_64/Makefile diff --git a/xen/Makefile b/xen/Makefile index f4bcfe46e1..dc381ab2e9 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -61,6 +61,7 @@ ifeq ($(ACM_SECURITY),y) $(MAKE) -C acm endif $(MAKE) -C arch/$(TARGET_ARCH) + $(MAKE) -C arch/$(TARGET_ARCH) $(TARGET) # drivers/char/console.o contains static banner/compile info. Blow it away. # Don't refresh these files during e.g., 'sudo make install' diff --git a/xen/Post.mk b/xen/Post.mk index 89a1d085ae..cc05380016 100644 --- a/xen/Post.mk +++ b/xen/Post.mk @@ -3,7 +3,6 @@ subdirs-all := $(subdirs-y) $(subdirs-n) obj-y += $(patsubst %,%/built_in.o,$(subdirs-y)) -default: built_in.o built_in.o: $(obj-y) $(LD) $(LDFLAGS) -r -o $@ $^ @@ -13,7 +12,7 @@ FORCE: %/built_in.o: FORCE $(MAKE) -C $* -clean: $(addprefix _clean_, $(subdirs-all)) +clean:: $(addprefix _clean_, $(subdirs-all)) FORCE rm -f *.o *~ core _clean_%/: FORCE $(MAKE) -C $* clean diff --git a/xen/Rules.mk b/xen/Rules.mk index b134449f98..55aab4c95e 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -36,18 +36,13 @@ HDRS := $(subst $(BASEDIR)/include/asm-$(TARGET_ARCH)/asm-offsets.h,,$(HDRS)) HDRS := $(subst $(BASEDIR)/include/xen/banner.h,,$(HDRS)) HDRS := $(subst $(BASEDIR)/include/xen/compile.h,,$(HDRS)) -C_SRCS := $(wildcard *.c) -S_SRCS := $(wildcard *.S) -OBJS := $(patsubst %.S,%.o,$(S_SRCS)) -OBJS += $(patsubst %.c,%.o,$(C_SRCS)) - include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk # Note that link order matters! ALL_OBJS-y += $(BASEDIR)/common/built_in.o ALL_OBJS-y += $(BASEDIR)/drivers/built_in.o ALL_OBJS-$(ACM_SECURITY) += $(BASEDIR)/acm/built_in.o -ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o +ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o CFLAGS-y += -g -D__XEN__ CFLAGS-$(ACM_SECURITY) += -DACM_SECURITY diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 30b391368b..429cec1b69 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -1,59 +1,61 @@ - include $(BASEDIR)/Rules.mk -OBJS += $(patsubst %.S,%.o,$(wildcard $(TARGET_SUBARCH)/*.S)) -OBJS += $(patsubst %.c,%.o,$(wildcard $(TARGET_SUBARCH)/*.c)) -OBJS += $(patsubst %.c,%.o,$(wildcard acpi/*.c)) -OBJS += $(patsubst %.c,%.o,$(wildcard genapic/*.c)) -OBJS += $(patsubst %.c,%.o,$(wildcard cpu/*.c)) -OBJS += $(patsubst %.c,%.o,$(wildcard cpu/mcheck/*.c)) -OBJS += $(patsubst %.c,%.o,$(wildcard cpu/mtrr/*.c)) -OBJS += $(patsubst %.c,%.o,$(wildcard hvm/*.c)) -OBJS += $(patsubst %.c,%.o,$(wildcard hvm/vmx/*.c)) -OBJS += $(patsubst %.S,%.o,$(wildcard hvm/vmx/$(TARGET_SUBARCH)/*.S)) -OBJS += $(patsubst %.c,%.o,$(wildcard hvm/svm/*.c)) -OBJS += $(patsubst %.S,%.o,$(wildcard hvm/svm/$(TARGET_SUBARCH)/*.S)) - -ifeq ($(TARGET_SUBARCH),x86_64) -OBJS := $(subst cpu/centaur.o,,$(OBJS)) -OBJS := $(subst cpu/cyrix.o,,$(OBJS)) -OBJS := $(subst cpu/rise.o,,$(OBJS)) -OBJS := $(subst cpu/transmeta.o,,$(OBJS)) -endif - -OBJS := $(patsubst shadow%.o,,$(OBJS)) # drop all -ifeq ($(TARGET_SUBARCH),x86_64) - OBJS += shadow.o shadow_public.o shadow_guest32.o shadow_guest32pae.o # x86_64: new code -endif -ifeq ($(TARGET_SUBARCH),x86_32) - ifneq ($(pae),n) - OBJS += shadow.o shadow_public.o shadow_guest32.o # x86_32p: new code - else - OBJS += shadow32.o # x86_32: old code - endif -endif - -ifneq ($(supervisor_mode_kernel),y) -OBJS := $(subst x86_32/supervisor_mode_kernel.o,,$(OBJS)) +subdirs-y += acpi +subdirs-y += cpu +subdirs-y += genapic +subdirs-y += hvm + +subdirs-$(x86_32) += x86_32 +subdirs-$(x86_64) += x86_64 + +obj-y += apic.o +obj-y += audit.o +obj-y += bitops.o +obj-y += delay.o +obj-y += dmi_scan.o +obj-y += dom0_ops.o +obj-y += domain.o +obj-y += domain_build.o +obj-y += e820.o +obj-y += extable.o +obj-y += flushtlb.o +obj-y += i387.o +obj-y += i8259.o +obj-y += io_apic.o +obj-y += irq.o +obj-y += microcode.o +obj-y += mm.o +obj-y += mpparse.o +obj-y += nmi.o +obj-y += physdev.o +obj-y += rwlock.o +obj-y += setup.o +obj-y += smp.o +obj-y += smpboot.o +obj-y += string.o +obj-y += time.o +obj-y += trampoline.o +obj-y += traps.o +obj-y += usercopy.o +obj-y += x86_emulate.o + +ifneq ($(pae),n) +obj-$(x86_32) += shadow.o shadow_public.o shadow_guest32.o +else +obj-$(x86_32) += shadow32.o endif -OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS)) -OBJS := $(subst $(TARGET_SUBARCH)/xen.lds.o,,$(OBJS)) +obj-$(x86_64) += shadow.o shadow_public.o shadow_guest32.o shadow_guest32pae.o -ifneq ($(crash_debug),y) -OBJS := $(patsubst gdbstub%.o,,$(OBJS)) -endif +obj-$(crash_debug) += gdbstub.o -default: $(TARGET) +include $(BASEDIR)/Post.mk $(TARGET): $(TARGET)-syms boot/mkelf32 ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \ `$(NM) $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'` -$(CURDIR)/arch.o: $(OBJS) - $(LD) $(LDFLAGS) -r -o $@ $(OBJS) - -$(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds +$(TARGET)-syms: boot/$(TARGET_SUBARCH).o xen.lds $(LD) $(LDFLAGS) -T xen.lds -N \ boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@ $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S @@ -77,21 +79,5 @@ boot/mkelf32: boot/mkelf32.c shadow_guest32.o: shadow.c -clean: - rm -f *.o *.s *~ core boot/*.o boot/*~ boot/core boot/mkelf32 - rm -f x86_32/*.o x86_32/*~ x86_32/core - rm -f x86_64/*.o x86_64/*~ x86_64/core - rm -f mtrr/*.o mtrr/*~ mtrr/core - rm -f acpi/*.o acpi/*~ acpi/core - rm -f genapic/*.o genapic/*~ genapic/core - rm -f cpu/*.o cpu/*~ cpu/core - rm -f hvm/*.o hvm/*~ hvm/core - rm -f hvm/vmx/*.o hvm/vmx/*~ hvm/vmx/core - rm -f hvm/vmx/x86_32/*.o hvm/vmx/x86_32/*~ hvm/vmx/x86_32/core - rm -f hvm/vmx/x86_64/*.o hvm/vmx/x86_64/*~ hvm/vmx/x86_64/core - rm -f hvm/svm/*.o hvm/svm/*~ hvm/svm/core - rm -f hvm/svm/x86_32/*.o hvm/svm/x86_32/*~ hvm/svm/x86_32/core - rm -f hvm/svm/x86_64/*.o hvm/svm/x86_64/*~ hvm/svm/x86_64/core - rm -f xen.lds - -.PHONY: default clean +clean:: FORCE + rm -f asm-offsets.s xen.lds boot/*.o boot/*~ boot/core boot/mkelf32 diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index a83b8b3a07..9bd3c94443 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -33,13 +33,17 @@ CFLAGS += -DCONFIG_X86_SUPERVISOR_MODE_KERNEL=1 endif ifeq ($(XEN_TARGET_ARCH),x86_32) -LDFLAGS += -m elf_i386 +LDFLAGS += -m elf_i386 +x86_32 := y +x86_64 := n endif ifeq ($(TARGET_SUBARCH),x86_64) CFLAGS += -mno-red-zone -fpic -fno-reorder-blocks CFLAGS += -fno-asynchronous-unwind-tables LDFLAGS += -m elf_x86_64 +x86_32 := n +x86_64 := y endif # Test for at least GCC v3.2.x. diff --git a/xen/arch/x86/acpi/Makefile b/xen/arch/x86/acpi/Makefile new file mode 100644 index 0000000000..6c0e68a8ac --- /dev/null +++ b/xen/arch/x86/acpi/Makefile @@ -0,0 +1,5 @@ +include $(BASEDIR)/Rules.mk + +obj-y += boot.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile new file mode 100644 index 0000000000..437f68fb2f --- /dev/null +++ b/xen/arch/x86/cpu/Makefile @@ -0,0 +1,16 @@ +include $(BASEDIR)/Rules.mk + +subdirs-y += mcheck +subdirs-y += mtrr + +obj-y += amd.o +obj-y += common.o +obj-y += intel.o +obj-y += intel_cacheinfo.o + +obj-$(x86_32) += centaur.o +obj-$(x86_32) += cyrix.o +obj-$(x86_32) += rise.o +obj-$(x86_32) += transmeta.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/cpu/mcheck/Makefile b/xen/arch/x86/cpu/mcheck/Makefile new file mode 100644 index 0000000000..7588c577b8 --- /dev/null +++ b/xen/arch/x86/cpu/mcheck/Makefile @@ -0,0 +1,11 @@ +include $(BASEDIR)/Rules.mk + +obj-y += k7.o +obj-y += mce.o +obj-y += non-fatal.o +obj-y += p4.o +obj-y += p5.o +obj-y += p6.o +obj-y += winchip.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/cpu/mtrr/Makefile b/xen/arch/x86/cpu/mtrr/Makefile new file mode 100644 index 0000000000..972ddb7f4b --- /dev/null +++ b/xen/arch/x86/cpu/mtrr/Makefile @@ -0,0 +1,10 @@ +include $(BASEDIR)/Rules.mk + +obj-y += amd.o +obj-y += centaur.o +obj-y += cyrix.o +obj-y += generic.o +obj-y += main.o +obj-y += state.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/genapic/Makefile b/xen/arch/x86/genapic/Makefile new file mode 100644 index 0000000000..4220d8f7fe --- /dev/null +++ b/xen/arch/x86/genapic/Makefile @@ -0,0 +1,10 @@ +include $(BASEDIR)/Rules.mk + +obj-y += bigsmp.o +obj-y += default.o +obj-y += es7000.o +obj-y += es7000plat.o +obj-y += probe.o +obj-y += summit.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile new file mode 100644 index 0000000000..c9aefe1c48 --- /dev/null +++ b/xen/arch/x86/hvm/Makefile @@ -0,0 +1,14 @@ +include $(BASEDIR)/Rules.mk + +subdirs-y += svm +subdirs-y += vmx + +obj-y += hvm.o +obj-y += i8259.o +obj-y += intercept.o +obj-y += io.o +obj-y += platform.o +obj-y += vioapic.o +obj-y += vlapic.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/hvm/svm/Makefile b/xen/arch/x86/hvm/svm/Makefile new file mode 100644 index 0000000000..442d526ea2 --- /dev/null +++ b/xen/arch/x86/hvm/svm/Makefile @@ -0,0 +1,12 @@ +include $(BASEDIR)/Rules.mk + +subdirs-$(x86_32) += x86_32 +subdirs-$(x86_64) += x86_64 + +obj-y += emulate.o +obj-y += instrlen.o +obj-y += intr.o +obj-y += svm.o +obj-y += vmcb.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/hvm/svm/x86_32/Makefile b/xen/arch/x86/hvm/svm/x86_32/Makefile new file mode 100644 index 0000000000..4191f3c4eb --- /dev/null +++ b/xen/arch/x86/hvm/svm/x86_32/Makefile @@ -0,0 +1,5 @@ +include $(BASEDIR)/Rules.mk + +obj-y += exits.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/hvm/svm/x86_64/Makefile b/xen/arch/x86/hvm/svm/x86_64/Makefile new file mode 100644 index 0000000000..4191f3c4eb --- /dev/null +++ b/xen/arch/x86/hvm/svm/x86_64/Makefile @@ -0,0 +1,5 @@ +include $(BASEDIR)/Rules.mk + +obj-y += exits.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/hvm/vmx/Makefile b/xen/arch/x86/hvm/vmx/Makefile new file mode 100644 index 0000000000..6b0f548eb3 --- /dev/null +++ b/xen/arch/x86/hvm/vmx/Makefile @@ -0,0 +1,10 @@ +include $(BASEDIR)/Rules.mk + +subdirs-$(x86_32) += x86_32 +subdirs-$(x86_64) += x86_64 + +obj-y += io.o +obj-y += vmcs.o +obj-y += vmx.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/hvm/vmx/x86_32/Makefile b/xen/arch/x86/hvm/vmx/x86_32/Makefile new file mode 100644 index 0000000000..4191f3c4eb --- /dev/null +++ b/xen/arch/x86/hvm/vmx/x86_32/Makefile @@ -0,0 +1,5 @@ +include $(BASEDIR)/Rules.mk + +obj-y += exits.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/hvm/vmx/x86_64/Makefile b/xen/arch/x86/hvm/vmx/x86_64/Makefile new file mode 100644 index 0000000000..4191f3c4eb --- /dev/null +++ b/xen/arch/x86/hvm/vmx/x86_64/Makefile @@ -0,0 +1,5 @@ +include $(BASEDIR)/Rules.mk + +obj-y += exits.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/x86_32/Makefile b/xen/arch/x86/x86_32/Makefile new file mode 100644 index 0000000000..6d834de89b --- /dev/null +++ b/xen/arch/x86/x86_32/Makefile @@ -0,0 +1,11 @@ +include $(BASEDIR)/Rules.mk + +obj-y += domain_page.o +obj-y += entry.o +obj-y += mm.o +obj-y += seg_fixup.o +obj-y += traps.o + +obj-$(supervisor_mode_kernel) += supervisor_mode_kernel.o + +include $(BASEDIR)/Post.mk diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile new file mode 100644 index 0000000000..82816f4ce5 --- /dev/null +++ b/xen/arch/x86/x86_64/Makefile @@ -0,0 +1,7 @@ +include $(BASEDIR)/Rules.mk + +obj-y += entry.o +obj-y += mm.o +obj-y += traps.o + +include $(BASEDIR)/Post.mk diff --git a/xen/common/Makefile b/xen/common/Makefile index 6f6d6c6c54..6ea5889540 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -1,4 +1,3 @@ - include $(BASEDIR)/Rules.mk obj-y += acm_ops.o -- 2.30.2